<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<div class="row">
	<div class="col-lg-10 offset-lg-1">
		<div class="btn-group m-b-1" role="group">
			<?php echo admin_tab_active($menu['setting']['tab'], 'base');?>
		</div>
		<div class="card">
			<div class="card-block">
				<form action="<?php echo url('setting-base');?>" method="post" id="form">
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">网站名称：</label>
						<div class="col-sm-10">
							<input type="text" id="sitename" name="sitename" class="form-control" value="<?php echo $conf['sitename'];?>">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">网站地址：</label>
						<div class="col-sm-10">
							<input type="text" id="sitelink" name="sitelink" class="form-control" value="<?php echo $conf['sitelink'];?>">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">网站介绍：</label>
						<div class="col-sm-10">
							<input type="text" id="sitelink" name="sitebrief" class="form-control" value="<?php echo $conf['sitebrief'];?>">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">关键字：</label>
						<div class="col-sm-10">
							<input type="text" id="keyword" name="keywords" class="form-control" value="<?php echo $conf['keywords'];?>">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">最小提现：</label>
						<div class="col-sm-10">
							<input type="text" id="cash_min" name="cash_min" class="form-control" value="<?php echo $conf['cash_min'];?>">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">最大提现：</label>
						<div class="col-sm-10">
							<input type="text" id="cash_max" name="cash_max" class="form-control" value="<?php echo $conf['cash_max'];?>">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">提现银行 (,隔开)：</label>
						<div class="col-sm-10">
							<input type="text" id="cash_bank" name="cash_bank" class="form-control" value="<?php echo implode(',', $conf['bank']);?>">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">提现类型银行 (,隔开)：</label>
						<div class="col-sm-10">
							<input type="text" id="cash_type_bank" name="cash_type_bank" class="form-control" value="<?php echo implode(',', $conf['type_bank']);?>">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">提现费用(百分比)：</label>
						<div class="col-sm-10">
							<input type="text" id="cash_min" name="cash_fee_percent" class="form-control" value="<?php echo $conf['cash_fee_percent'];?>">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">提现费用(固定)：</label>
						<div class="col-sm-10">
							<input type="text" id="cash_min" name="cash_fee_fixed" class="form-control" value="<?php echo $conf['cash_fee_fixed'];?>">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">银行卡最大绑定：</label>
						<div class="col-sm-10">
							<input type="text" id="bank_card_max" name="bank_card_max" class="form-control" value="<?php echo $conf['bank_card_max'];?>">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">注册审核：</label>
						<div class="col-sm-10">
							<select id="register_check" name="register_check" class="form-control">
								<option value="0">否</option>
								<option value="1" <?php if($conf['register_check']==1){echo 'selected';} ?>>是</option>
							</select>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">通道选择方式：</label>
						<div class="col-sm-10">
							<select id="channel_sort" name="channel_sort" class="form-control">
								<option value="0">顺序选取</option>
								<option value="1" <?php if($conf['channel_sort']==1){echo 'selected';} ?>>随机选取</option>
							</select>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">连续多少笔订单失败关闭通道：</label>
						<div class="col-sm-10">
							<input type="text" id="channel_overtimes" name="channel_overtimes" class="form-control" value="<?php echo $conf['channel_overtimes'];?>">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">认定订单失败的时长(秒)：</label>
						<div class="col-sm-10">
							<input type="text" id="order_overtime" name="order_overtime" class="form-control" value="<?php echo $conf['order_overtime'];?>">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">原转账设置安全码：</label>
						<div class="col-sm-10">
							<input type="password" id="passcode_old" name="passcode_old" class="form-control" value="" placeholder="修改安全码时，需要验证">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">新转账设置安全码：</label>
						<div class="col-sm-10">
							<input type="password" id="passcode" name="passcode" class="form-control" value="">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">是否开启短信接口：</label>
						<div class="col-sm-10">
							<select id="is_open_sms" name="is_open_sms" class="form-control">
								<option value="0" <?php if($conf['is_open_sms']==0){echo 'selected';} ?>>否</option>
								<option value="1" <?php if($conf['is_open_sms']==1){echo 'selected';} ?>>是</option>
							</select>
						</div>
					</div>
					<div class="form-group row">
						<label for="inputPassword3" class="col-sm-2 form-control-label"></label>
						<div class="col-sm-10">
							<button type="submit" class="btn btn-primary btn-block" id="submit" data-loading-text="提交中...">确认</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>

<!--{hook admin_setting_base_end.htm}-->
	
<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>

<script>
var jform = $('#form');
var jsubmit = $('#submit');

jform.base64_encode_file();

jform.on('submit', function() {
	jform.reset();
	jsubmit.button('loading');
	var postdata = jform.serialize();
	$.xpost(jform.attr('action'), postdata, function(code, message) {
		if(code == 0) {
			$.alert(message);
			jsubmit.text(message).delay(1000).button('reset');
			setTimeout(function(){
				window.location.reload();
			},1500);
		} else if(code < 0) {
			$.alert(message);
			jsubmit.button('reset');
		} else {
			jform.find('[name="'+code+'"]').alert(message).focus();
			jsubmit.button('reset');
		}
	});
	return false;
});

$('#nav_pc li.setting, #nav_mobile li.setting').tab('show');
</script>